package rtda

type Thread struct{
	pc int  //寄存器 存放当前正在执行的java虚拟机指令的地址
	stack *Stack
}

func NewThread()*Thread  {
	return &Thread{
		stack:newStack(1024),
	}
}

func (self *Thread)PC()int  {
	return self.pc
}

func (self *Thread)SetPc(pc int)  {
	self.pc = pc;
}

func (self *Thread)PushFrame(frame *Frame)  {
	self.stack.push(frame)	
}

func (self *Thread)PopFrame()*Frame  {
	return self.stack.pop();	
}

func (self *Thread)CurrentFrame()*Frame  {
	return self.stack.top()
}